@extends('app')
@section('content')
<ul class="nav nav-tabs">
    <li><a href="{{ url('/admin/user')}}">考勤详情</a></li>
</ul>
<form id="userForm" method="post" action="">
    <div class="panel panel-default description2 mt20">
        <div class="form-group clearfix">
            <label class="col-xs-12 col-sm-3 col-md-2 control-label" style="padding-left: 0;padding-right: 0;">用户名：</label>
            <div class="col-sm-9 col-xs-12" style="padding-left: 0;padding-right: 0;">
                 {{getUserName($att->user_id)}}
            </div>
        </div>
        <div class="form-group clearfix">
            <label class="col-xs-12 col-sm-3 col-md-2 control-label" style="padding-left: 0;padding-right: 0;">业绩月份：</label>
            <div class="col-sm-9 col-xs-12" style="padding-left: 0;padding-right: 0;">
                <select name="dateid" class="form-control">
                    @foreach($date as $g)
                        <option value="{{ $g }}" @if(!empty($att)) @if($g == $att->date) selected @endif @endif>{{ $g }}</option>
                    @endforeach
                </select>
                <button type="button" class="btn btn-info" onclick="perdUrl();">
                    <i class="icon-ok bigger-110"></i>
                    确定
                </button>
            </div>
        </div>
        <div class="form-group clearfix">
            <label class="col-xs-12 col-sm-3 col-md-2 control-label" style="padding-left: 0;padding-right: 0;">业绩目标：</label>
            <div class="col-sm-9 col-xs-12" style="padding-left: 0;padding-right: 0;">
                {{$att->goal}}
            </div>
        </div>
        <div class="form-group clearfix">
            <label class="col-xs-12 col-sm-3 col-md-2 control-label" style="padding-left: 0;padding-right: 0;">业绩完成情况：</label>
            <div class="col-sm-9 col-xs-12" style="padding-left: 0;padding-right: 0;">
                {{$att->achievement}}
            </div>
        </div>
        <div class="form-group clearfix">
            <label class="col-xs-12 col-sm-3 col-md-2 control-label" style="padding-left: 0;padding-right: 0;">该月业绩总分：</label>
            <div class="col-sm-9 col-xs-12" style="padding-left: 0;padding-right: 0;">
                {{$att->score}}
            </div>
        </div>
        <div class="form-group clearfix">
            <label class="col-xs-12 col-sm-3 col-md-2 control-label" style="padding-left: 0;padding-right: 0;">该月业绩完成度：</label>
            <div class="col-sm-9 col-xs-12" style="padding-left: 0;padding-right: 0;">
                {{$att->percent}}%
            </div>
        </div>
        {!! csrf_field() !!}
    </div>
    <input type="hidden" name="uid" value="@if(!empty($uid)){{ $uid }}@endif">
</form>
<script>
    function perdUrl(){
        var dateid = $('select[name=dateid]').val();
        var uid = $('input[name=uid]').val();
        var perfurl = '/admin/performance/detail?uid='+uid+'&dateid='+dateid;
        window.location.href=perfurl;
    }
</script>
<script>
    $('.list-group-item').eq(1).addClass('active');
</script>
@endsection
